package Tools;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) throws Exception {
//        stuhh select = jdbcTools.select("select * from stuhh where id=?", stuhh.class, 2);
//        System.out.println("select = " + select);
        //jdbcTools.update1("update stuhh set name=?,age=? where id=?","u",11,1);
//        List<stuhh> selectall = jdbcTools.selectall("select * from stuhh", stuhh.class);
//        System.out.println("selectall = " + selectall);
//        ArrayList<Map> maps = jdbcTools.queryMapList("select * from stuhh where name=?", "pp");
//       // System.out.println("maps = " + maps);
//        for (int i = 0; i < maps.size(); i++) {
//            System.out.println("maps.get(i) = " + maps.get(i));
    //}
        //获取一句语句的最前面一条
        //Object[] pps = jdbcTools.queryArray("select * from stuhh where name=?", "pp");
        //获取一句语句的最后一条
        Object[] pps = jdbcTools.queryArray("select * from stuhh where name=? order by id desc limit 1", "pp");
        System.out.println("Arrays.toString(pps) = " + Arrays.toString(pps));
//        List<Object[]> objects = jdbcTools.queryArrayList("select * from stuhh where name=?", "pp");
//        for (int i = 0; i < objects.size(); i++) {
//            System.out.println("Arrays.toString(objects.get(i)) = " + Arrays.toString(objects.get(i)));
        //}
//        Map<String, Object> pp = jdbcTools.queryMap("select * from stuhh where name=?", "pp");
//        System.out.println("pp = " + pp);
    }
}
